<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://lib.baomitu.com/Turf.js/latest/turf.min.js"></script>
</head>

<body>
    <script>
        var line = turf.lineString([[114.4, 30.6], [114.45, 30.2]]);
        var polygon = turf.polygon([
            [

                [114.301586, 30.533613],
                [114.301586, 30.396517],
                [114.544453, 30.396517],
                [114.444453, 30.533613],
                [114.401586, 30.533613],
                [114.301586, 30.533613]
            ]
        ])
        /* 判断是否相交 */
        var result = turf.booleanCrosses(polygon, line);
        console.log(result)
    </script>
</body>

</html>